/*
	Created: Jonathan Turner
		On : 10/18/2013
Description: Gets list of configuration settings
	Updates:
*/
ALTER PROCEDURE daycare.GetConfigurationSettings
  @ConfigurationSettingsGroupId INT = NULL
AS 
  SELECT  cs.ConfigurationSettingsId
        , cs.ConfigurationSettingsName
        , cs.ConfigurationSettingsDescription
        , cs.ConfigurationSettingsGroupId
        , csg.ConfigurationsettingsGroupName
  FROM    daycare.ConfigurationSettings AS cs
  INNER JOIN daycare.ConfigurationSettingsGroups AS csg ON cs.ConfigurationSettingsGroupid = csg.ConfigurationSettingsGroupId
  WHERE   (
           cs.ConfigurationSettingsId = @ConfigurationSettingsGroupId
           OR @ConfigurationSettingsGroupId IS NULL
          )

GO